<?php
function loadFile($sFilename, $sCharset = 'UTF-8')
{
    if (floatval(phpversion()) >= 4.3) {
        $sData = file_get_contents($sFilename);
    } else {
        if (!file_exists($sFilename)) return -3;
        $rHandle = fopen($sFilename, 'r');
        if (!$rHandle) return -2;

        $sData = '';
        while(!feof($rHandle))
            $sData .= fread($rHandle, filesize($sFilename));
        fclose($rHandle);
    }
    return $sData;
}
if(isset($_POST['productType'])){
  if(isset($_POST['key'])){
    if($_POST['key']=='similarItems'){
	  $data = loadFile($_POST['productType'].'Load.json');
      echo $data;
	}else if($_POST['key']=='otherItems'){
	  $data = loadFile('othersLoad.json');
      echo $data;
	}
  }
}
?>